# coding=utf-8

from web import form
from define import TRAVEL_TYPES

# 项目表单
project_form = form.Form(
        form.Textbox('name'
            , description = '名称'
            , class_ = 'txt'
            , tabindex = 1),
        form.Dropdown('type'
            , [(v, t) for v,t,e in TRAVEL_TYPES]
            , description = '类型'
            , class_ = 'txt'
            , tabindex = 2),
        form.Dropdown('dest_id'
            , []
            , description = '目的地'
            , class_ = 'txt'
            , tabindex = 3),
        form.Button('submit'
            , class_ = 'btn'
            , html = u'添加新项目'
            , tabindex = 4))

# 标签表单
tags_form = form.Form(
        form.Textbox('name'
            , description = '标签名'
            , class_ = 'txt'
            , tabindex = 1),
        form.Button('submit'
            , class_ = 'btn'
            , html = u'添加新标签'
            , tabindex = 2))

# 目的地表单
destination_form = form.Form(
        form.Textbox('name'
            , description = '名称'
            , class_ = 'txt'
            , tabindex = 1),
        form.Dropdown('parent'
            , []
            , description = '父级'
            , tabindex = 2),
        form.Dropdown('type'
            , [('1', '境内游'), ('2', '境外游')]
            , description = '类型'
            , class_ = 'txt'
            , tabindex = 3),
        form.Button('submit'
            , class_ = 'btn'
            , html = u'添加新目的地'
            , tabindex = 4))
